﻿using DataLayer.Types;

namespace ViewModel.Finance
{
    public class BalanceTypePropertiesViewModel: ItemPropertiesViewModel<BalanceType>
    {

        public BalanceTypePropertiesViewModel(BalanceType balanceType)
            : base(balanceType)
        {
            LoadData();
        }

        private void LoadData()
        {
            name = Item.Name;
        }

        private void CollectData()
        {
            Item.Name = name;
        }

        /// <summary>
        /// Collects the form data into the BudgetItem object and then saves it to the database.
        /// </summary>
        /// <returns></returns>
        public bool Save()
        {
            CollectData();
            Item.Save();
            return true;
        }

    }
}
